﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FOModels.AppConfig;
using Bussiness.AppConfig;
using FOSystem.CultureHelper;
using Bussiness.Language;
using FOModels.Language;
using FOModels.Articles;
using Bussiness.Articles;
using Bussiness.User;
using FOModels.Ads;
using Bussiness.Ads;
namespace FO.Controllers
{
    public class HomeController : CultureController
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            ArticlesBLL bll = new ArticlesBLL();
            AdsBLL adsbll = new AdsBLL();
            LanguageBLL langbll = new LanguageBLL();
            Language lang = langbll.getLangByCode(Request.Cookies["_culture"]["lang"]);
            int HomeArticlesID = int.Parse(System.Configuration.ConfigurationManager.AppSettings["HomeArticlesID"].ToString());
            int AdsPageIndexID = int.Parse(System.Configuration.ConfigurationManager.AppSettings["AdsPageIndexID"].ToString());
            ViewBag.AppConfig = bll.getArticlesByIDShow(HomeArticlesID, lang.LangID);
            ViewBag.Ads = adsbll.getAdsByPageID(AdsPageIndexID, 1, lang.LangID);
            UserBLL user = new UserBLL();
            return View();
        }



    }
}
